rust: Regenerate and release 0.20.5
authorAlexander Larsson <alexl@redhat.com>
Fri, 26 Sep 2025 13:37:50 +0000 (15:37 +0200)
committerAlexander Larsson <alexl@redhat.com>
Fri, 26 Sep 2025 13:38:17 +0000 (15:38 +0200)
This adds the new bindings for signing and composefs use.

rust-bindings/src/auto/blob_reader.rs [new file with mode: 0644]
rust-bindings/src/auto/functions.rs
rust-bindings/src/auto/mod.rs
rust-bindings/src/auto/repo.rs
rust-bindings/src/auto/sign.rs
rust-bindings/src/auto/versions.txt
rust-bindings/sys/src/auto/versions.txt
rust-bindings/sys/src/lib.rs

diff --git a/rust-bindings/src/auto/blob_reader.rs b/rust-bindings/src/auto/blob_reader.rs
new file mode 100644 (file)
index 0000000..1957b8a
--- /dev/null
@@ -0,0 +1,38 @@
+// This file was generated by gir (https://github.com/gtk-rs/gir)
+// from gir-files
+// DO NOT EDIT
+
+use crate::{ffi};
+use glib::{prelude::*};
+#[cfg(feature = "v2016_5")]
+#[cfg_attr(docsrs, doc(cfg(feature = "v2016_5")))]
+use glib::{translate::*};
+
+glib::wrapper! {
+    #[doc(alias = "OstreeBlobReader")]
+    pub struct BlobReader(Interface<ffi::OstreeBlobReader, ffi::OstreeBlobReaderInterface>);
+
+    match fn {
+        type_ => || ffi::ostree_blob_reader_get_type(),
+    }
+}
+
+impl BlobReader {
+        pub const NONE: Option<&'static BlobReader> = None;
+    
+}
+
+pub trait BlobReaderExt: IsA<BlobReader> + 'static {
+    #[cfg(feature = "v2016_5")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "v2016_5")))]
+    #[doc(alias = "ostree_blob_reader_read_blob")]
+    fn read_blob(&self, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<Option<glib::Bytes>, glib::Error> {
+        unsafe {
+            let mut error = std::ptr::null_mut();
+            let ret = ffi::ostree_blob_reader_read_blob(self.as_ref().to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
+            if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
+        }
+    }
+}
+
+impl<O: IsA<BlobReader>> BlobReaderExt for O {}
index a5cded8a13958421e650edf66161c8c1ba504d7c..df5744b882718911ba0941f8c3e0f677171b28bd 100644 (file)
@@ -92,12 +92,17 @@ pub fn commit_get_timestamp(commit_variant: &glib::Variant) -> u64 {
     }
 }
 
-//#[cfg(feature = "v2021_1")]
-//#[cfg_attr(docsrs, doc(cfg(feature = "v2021_1")))]
-//#[doc(alias = "ostree_commit_metadata_for_bootable")]
-//pub fn commit_metadata_for_bootable(root: &impl IsA<gio::File>, dict: /*Ignored*/&glib::VariantDict, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
-//    unsafe { TODO: call ffi:ostree_commit_metadata_for_bootable() }
-//}
+#[cfg(feature = "v2021_1")]
+#[cfg_attr(docsrs, doc(cfg(feature = "v2021_1")))]
+#[doc(alias = "ostree_commit_metadata_for_bootable")]
+pub fn commit_metadata_for_bootable(root: &impl IsA<gio::File>, dict: &glib::VariantDict, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
+    unsafe {
+        let mut error = std::ptr::null_mut();
+        let is_ok = ffi::ostree_commit_metadata_for_bootable(root.as_ref().to_glib_none().0, dict.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
+        debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
+        if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
+    }
+}
 
 #[doc(alias = "ostree_content_file_parse")]
 pub fn content_file_parse(compressed: bool, content_path: &impl IsA<gio::File>, trusted: bool, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(gio::InputStream, gio::FileInfo, glib::Variant), glib::Error> {
index d5ab73b2ba9c168d3b828527ecc7c9052c280461..5b4a1592d3a676fa788351f6fe058582001ce607 100644 (file)
@@ -5,6 +5,9 @@
 mod async_progress;
 pub use self::async_progress::AsyncProgress;
 
+mod blob_reader;
+pub use self::blob_reader::BlobReader;
+
 mod bootconfig_parser;
 pub use self::bootconfig_parser::BootconfigParser;
 
@@ -186,6 +189,7 @@ pub use self::constants::SUMMARY_SIG_GVARIANT_STRING;
 pub use self::constants::TREE_GVARIANT_STRING;
 
 pub(crate) mod traits {
+    pub use super::blob_reader::BlobReaderExt;
     pub use super::repo_finder::RepoFinderExt;
     pub use super::sign::SignExt;
 }
index 78b90b6b1ac956975d20221ec1e578f2fada0730..bb9d4da38fc74394d877ad43eedf09b8ac559aa6 100644 (file)
@@ -133,10 +133,15 @@ impl Repo {
         }
     }
 
-    //#[doc(alias = "ostree_repo_commit_add_composefs_metadata")]
-    //pub fn commit_add_composefs_metadata(&self, format_version: u32, dict: /*Ignored*/&glib::VariantDict, repo_root: &RepoFile, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
-    //    unsafe { TODO: call ffi:ostree_repo_commit_add_composefs_metadata() }
-    //}
+    #[doc(alias = "ostree_repo_commit_add_composefs_metadata")]
+    pub fn commit_add_composefs_metadata(&self, format_version: u32, dict: &glib::VariantDict, repo_root: &RepoFile, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
+        unsafe {
+            let mut error = std::ptr::null_mut();
+            let is_ok = ffi::ostree_repo_commit_add_composefs_metadata(self.to_glib_none().0, format_version, dict.to_glib_none().0, repo_root.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
+            debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
+            if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
+        }
+    }
 
     #[doc(alias = "ostree_repo_commit_transaction")]
     pub fn commit_transaction(&self, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<RepoTransactionStats, glib::Error> {
index bda6c8c4df1118203db22539a70b65e7aa394fb9..2da863ea9839c7a8de255615d35be434d628878b 100644 (file)
@@ -6,6 +6,9 @@ use crate::{ffi};
 #[cfg(feature = "v2020_2")]
 #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))]
 use crate::{Repo};
+#[cfg(feature = "v2025_2")]
+#[cfg_attr(docsrs, doc(cfg(feature = "v2025_2")))]
+use crate::{BlobReader};
 use glib::{prelude::*};
 #[cfg(feature = "v2020_2")]
 #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))]
@@ -163,19 +166,23 @@ pub trait SignExt: IsA<Sign> + 'static {
         }
     }
 
-    //#[cfg(feature = "v2025_2")]
-    //#[cfg_attr(docsrs, doc(cfg(feature = "v2025_2")))]
-    //#[doc(alias = "ostree_sign_read_pk")]
-    //fn read_pk(&self, stream: &impl IsA<gio::InputStream>) -> /*Ignored*/BlobReader {
-    //    unsafe { TODO: call ffi:ostree_sign_read_pk() }
-    //}
+    #[cfg(feature = "v2025_2")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "v2025_2")))]
+    #[doc(alias = "ostree_sign_read_pk")]
+    fn read_pk(&self, stream: &impl IsA<gio::InputStream>) -> BlobReader {
+        unsafe {
+            from_glib_full(ffi::ostree_sign_read_pk(self.as_ref().to_glib_none().0, stream.as_ref().to_glib_none().0))
+        }
+    }
 
-    //#[cfg(feature = "v2025_2")]
-    //#[cfg_attr(docsrs, doc(cfg(feature = "v2025_2")))]
-    //#[doc(alias = "ostree_sign_read_sk")]
-    //fn read_sk(&self, stream: &impl IsA<gio::InputStream>) -> /*Ignored*/BlobReader {
-    //    unsafe { TODO: call ffi:ostree_sign_read_sk() }
-    //}
+    #[cfg(feature = "v2025_2")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "v2025_2")))]
+    #[doc(alias = "ostree_sign_read_sk")]
+    fn read_sk(&self, stream: &impl IsA<gio::InputStream>) -> BlobReader {
+        unsafe {
+            from_glib_full(ffi::ostree_sign_read_sk(self.as_ref().to_glib_none().0, stream.as_ref().to_glib_none().0))
+        }
+    }
 
     #[cfg(feature = "v2020_2")]
     #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))]
index 6bc2563d5b971b135ccb2281d259135a491eb86c..cc83a324eae16f1b6973a8dc79ceb8e13051e6c0 100644 (file)
@@ -1,2 +1,2 @@
 Generated by gir (https://github.com/gtk-rs/gir @ 19ccbbc9a3d1)
-from gir-files (@ ac81709f18d2)
+from gir-files (@ 9ff946fcca99)
index 6bc2563d5b971b135ccb2281d259135a491eb86c..cc83a324eae16f1b6973a8dc79ceb8e13051e6c0 100644 (file)
@@ -1,2 +1,2 @@
 Generated by gir (https://github.com/gtk-rs/gir @ 19ccbbc9a3d1)
-from gir-files (@ ac81709f18d2)
+from gir-files (@ 9ff946fcca99)
index c430fb7d993bdb9bd6f372ae5471338c12412e5e..253e73d15fa82ac4a90088e31f5d2dd5760d9f20 100644 (file)
@@ -3473,6 +3473,8 @@ extern "C" {
     // OstreeBlobReader
     //=========================================================================
     pub fn ostree_blob_reader_get_type() -> GType;
+    #[cfg(feature = "v2016_5")]
+    #[cfg_attr(docsrs, doc(cfg(feature = "v2016_5")))]
     pub fn ostree_blob_reader_read_blob(
         self_: *mut OstreeBlobReader,
         cancellable: *mut gio::GCancellable,